# -*- coding: utf-8 -*-
# @Author: gengxd
# @Time:   2020-6-24 16:06
# @File:   fileType


import sys
import os
import filetype

print(os.path.dirname(__file__))
attPath = os.path.abspath(os.path.join(os.path.dirname(__file__),"./../","attachment"))
attName = '15.jpg'


def main():
    fileType = filetype.guess(attPath + '\\' + attName)
    print(attPath + '\\' + attName)
    if fileType is None:
        print('Can not guess file type!')
    else:
        print('File extension: %s' % fileType.extension)
        print('File MIME type: %s' % fileType.mime)
    return fileType

if __name__ == '__main__':
    obj = main()
    print(obj.extension)